chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
	if (request.action == "catch") {
		// code below catches content from all textboxes and textareas on the
		// page
		// and all content is collected in one variable collectedText
		// content from different textboxes and areas is diveded with /
		var collectedText = "";
		if (document.getElementById("wpTextbox1") != null) {
			collectedText = document.getElementById("wpTextbox1").value;
		} else {

			var SPLITER = "  ";
			var inputs = document.getElementsByTagName('input');
			for ( var k = 0; k < inputs.length; k++) {
				var input = inputs[k];
				if (input.type != 'text')
					continue;
				if (input.value != '') {
					collectedText = collectedText + input.value;
					collectedText = collectedText + SPLITER;
				}
			}
			inputs = document.getElementsByTagName('textarea');
			for ( var k = 0; k < inputs.length; k++) {
				var input = inputs[k];
				if (input.value != '') {
					collectedText = collectedText + input.value;
					collectedText = collectedText + SPLITER;
				}
			}
		}
		// this next statement is not connected with collecting content
		// so if you put this script in addon do not put the line below
		sendResponse( {
			content : collectedText
		});
	}
});